// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** redirectLongUrl GET /api/sl/${param0} */
export async function redirectLongUrlUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.redirectLongUrlUsingGETParams,
  options?: { [key: string]: any },
) {
  const { shortUrl: param0, ...queryParams } = params;
  return request<any>(`/api/sl/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** generateShortUrl POST /api/sl/generate */
export async function generateShortUrlUsingPost(
  body: API.ShortLinkAddRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseShortLinkVo_>('/api/sl/generate', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
